package com.pigdogbay.androidutils.mvp;

import com.pigdogbay.androidutils.R;
import com.pigdogbay.androidutils.utils.PreferencesHelper;


public class BackgroundColorModel implements IBackgroundColorModel{
	PreferencesHelper _PreferencesHelper;
	public BackgroundColorModel(PreferencesHelper prefHelper)
	{
		_PreferencesHelper = prefHelper;
	}
	@Override
	public boolean getUnlockColorPack()
	{
		return _PreferencesHelper.getBoolean(R.string.code_pref_unlock_color_pack_key, false);
	}
	@Override
	public void setUnlockColorPack(boolean unlock)
	{
		_PreferencesHelper.setBoolean(R.string.code_pref_unlock_color_pack_key,unlock);
	}
	@Override
	public int getBackgroundId()
	{
        int colorIndex =_PreferencesHelper.getInt(R.string.code_pref_background_colour, 0);
		switch (colorIndex){
		case 1:
			return R.drawable.bgpink;
		case 2:
			return R.drawable.bglightpink;
		case 3:
			return R.drawable.bgturquoise;
		case 4:
			return R.drawable.bgsunshine;
		case 5:
			return R.drawable.bggrey;
		case 6:
			return R.drawable.white;
		}
		return R.drawable.bgskyblue;
	}
	@Override
	public int getDefaultBackgroundId() {
		return R.drawable.bgskyblue;
	}
	

}
